package cn.itcast.service;


import cn.itcast.pojo.*;

import java.io.IOException;
import java.net.MalformedURLException;
import java.util.List;
import java.util.Map;

public interface UserService {

    boolean updateUserInfo(user user);

    user findUserInfo(String openId);

    int findCountOrder(String openId);

    double findCountEarning(String openId);

    boolean addDistribution(String openId, String distribution);

    String findUserToken(String openId) throws IOException;

    Map<String,List<user>> findUserDistribution(String openId);

    List<earnings> findAllEarnings(String openId);

    Map<String, List<earnings>> findTypeEarnings(String openId);

    boolean sendOrder(Integer orderId, String openId, String name,String DispatchOpenId);

    List<withdraw> findUnWithdraw();

    /**
     * 根据提现id审核提现申请
     * @param id
     * @return
     */
    Boolean checkWithdraw(Integer id);

    /**
     * 提现审核失效
     * @param id
     * @return
     */
    Boolean lostEffect(Integer id);

    List<helpCenter> findAllHelp();

    helpCenter findHelp(Integer id);

    /**
     * 根据用户的提现id查询该用户的所有订单
     * @param page
     * @param limit
     * @return
     */
    Map<String,Object> getOrderById(Integer page, Integer limit, String openId,String state );

    boolean isPhone(String openId);

    String findUserPhone(String encryptedData, String iv,String openId);

    /**
     *功能：获取该账号一二级推广
     * @author 张松
     * @date 2020/6/22
      * @param
     * @return java.util.List<cn.itcast.pojo.user>
     */
    Map<String,Object> getPromotionManagementOne(String openId,Integer pageNum,Integer pageSize);

    /**
     *功能：获取该账号一二级推广
     * @author 张松
     * @date 2020/6/22
     * @param
     * @return java.util.List<cn.itcast.pojo.user>
     */
    Map<String,Object> getPromotionManagementTwo(String openId,Integer pageNum,Integer pageSize);



    /**
     *功能：查询昨天新增的用户数和查询他们是谁推广的
     * @author 张松
     * @date 2020/6/24
      * @param
     * @return java.util.List<cn.itcast.pojo.user>
     */
    List<user> getYesterdayAdduser();


    /**
     *
     * @Description: 查看全部用户数
     *
     * @auther: 张松
     * @date: 14:23 2020/6/26
     * @param: []
     * @return: java.lang.Integer
     *
     */
    Integer selectAllUserCount();

    /**
     *
     * @Description:  查看是否有这个手机号
     *
     * @auther: 张松
     * @date: 9:20 2020/7/14
     * @param: [phone]
     * @return: cn.itcast.pojo.user
     *
     */

    user selectUserPhone(String phone);

    /**
     *
     * @Description: 获取每日新增用户
     *
     * @auther: 张松
     * @date: 9:08 2020/7/18
     * @param: [intDate]  查看相隔天数
     * @return: void
     *
     */
    List<user> getEveryDayAllAddUser(Integer intDate);
}